From 244f89a35b23674e10ac4c15edba6ebe3e206011 Mon Sep 17 00:00:00 2001 From: Antonio Valentino Date: Sat, 21 Dec 2019 16:52:35 +0000 Subject: [PATCH] Fix pttree Fix the mamagement of UnImplemented objects in the pttree tool. Patch backorted from upstream: https://github.com/PyTables/PyTables/commit/5280b856189a05ceee8f034d8781d052fb5dbe5a Closes: #941954. Gbp-Pq: Name 0006-Fix-pttree.patch --- tables/scripts/pttree.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tables/scripts/pttree.py b/tables/scripts/pttree.py index 1ba7045..8101a6b 100644 --- a/tables/scripts/pttree.py +++ b/tables/scripts/pttree.py @@ -175,7 +175,10 @@ def get_tree_str(f, where='/', max_depth=-1, print_class=True, ref_idx[path] = ref_count[addr] hl_addresses[path] = addr - if isinstance(node, tables.Leaf): + if isinstance(node, tables.UnImplemented): + leaves.append(node) + + elif isinstance(node, tables.Leaf): # only count the size of a hardlinked leaf the first time it is # visited @@ -201,7 +204,7 @@ def get_tree_str(f, where='/', max_depth=-1, print_class=True, except NotImplementedError as e: # size_on_disk is not implemented for VLArrays - warnings.warn(e.message) + warnings.warn(str(e)) # push leaf nodes onto the stack for the next pass leaves.append(node) -- 2.30.2